package com.jintian.smart.base.api.security.entity;

import com.jintian.smart.kernel.core.domain.IEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.beetl.sql.annotation.builder.FillStrategy;
import org.beetl.sql.annotation.builder.UpdateTime;
import org.beetl.sql.annotation.entity.AssignID;
import org.beetl.sql.annotation.entity.Table;

import java.time.LocalDateTime;

/**
 * 登录日志
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sec_log_login")
public class LoginLogEntity implements IEntity {
    @AssignID("snowid")
    private Long loginLogId;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 用户类型
     */
    private Integer userType;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 登录ip
     */
    private String loginIp;

    /**
     * 登录ip地区
     */
    private String loginIpRegion;

    /**
     * user-agent
     */
    private String userAgent;

    /**
     * 备注
     */
    private String remark;

    /**
     * 登录设备
     */
    private String loginDevice;

    /**
     * 登录类型
     */
    private Integer loginResult;

    @UpdateTime(FillStrategy.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @UpdateTime(FillStrategy.INSERT)
    private LocalDateTime createTime;
}
